//
//  ViewPlanController.m
//  Wallets Manager
//
//  Created by Tung Nguyen on 10/13/12.
//  Copyright (c) 2012 BKHN. All rights reserved.
//

#import "ViewPlanController.h"

@interface ViewPlanController ()

@end

@implementation ViewPlanController
@synthesize planNameTextField;
@synthesize goalTextField;
@synthesize startAmountTextField;
@synthesize planImageView;
@synthesize walletLabe;
@synthesize currentPlan;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    folyAppDelegate *delegate = [[UIApplication sharedApplication]delegate];
    
    planNameTextField.text = currentPlan.p_name;
    goalTextField.text =[NSString stringWithFormat:@"%d", [currentPlan.p_amount intValue]];
    startAmountTextField.text =[NSString stringWithFormat:@"%d", [currentPlan.p_startamount intValue]];
    [planImageView setImage:[UIImage imageNamed:currentPlan.p_image]];
    walletLabe.text = delegate.currentWallet.w_name;
    // Do any additional setup after loading the view from its nib.
}

- (void)viewDidUnload
{
    [self setPlanNameTextField:nil];
    [self setGoalTextField:nil];
    [self setStartAmountTextField:nil];
    [self setPlanImageView:nil];
    [self setWalletLabe:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (IBAction)backButtonPressed:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}
@end
